package com.ww.springboot.drools.controller;

import com.ww.springboot.drools.bean.Person;
import com.ww.springboot.drools.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 描述：
 *
 * @author wanwei
 * @since 2021-11-23 18:16
 */
@RequestMapping("test")
@Controller
public class TestController {

    @Autowired
    private TestService testService;


    @ResponseBody
    @RequestMapping("test1")
    public String test() {
        testService.test();
        return "";
    }

    @ResponseBody
    @RequestMapping("initRule")
    public String initRule() {
        testService.initRule();
        return "OK";
    }

    @ResponseBody
    @RequestMapping("test3")
    public String test3(String name, String className) {
        Person person = new Person();
        person.setName(name);
        person.setClassName(className);
        testService.test3(person);
        return "OK";
    }
}
